<layout name='Layout/layout_main' />

<script type="text/javascript">
	var manager = null;
	function add(){
		$("#form_data :input[type='hidden']").val("");
		$("#form_data :text").val("");
		$("#form_data select ").each(function() {
			$(this).find('option:first').attr('selected', 'selected');
		});		
		$("#opmode").val("add");
	};

	function save() {
		if (check_form("form_data")) {
			sendForm("form_data", "{:U('save')}", "__URL__");
		}
	}

	function test() {
		form_search.submit();
	};

	function showdata(result) {
		for (var s in result.data) {
			set_val(s, result.data[s]);
		}
		$("#opmode").val("edit");
	}


	$(document).ready(function() {
		$(".sub_left_menu .tree_menu  a").click(function() {
			$(".sub_left_menu .tree_menu  a").each(function() {
				$(this).attr("class", "");
			});
			$(this).attr("class", "active");
			sendAjax("{:U('read')}", "id=" + $(this).attr("node"), function(data) {
				showdata(data);
			});
			return false;
		})
	});

</script>
<div class="title panel panel-default">
<div class="panel-body">
	<h3 class="col-md-12">业务权限管理</h3></div>
</div>
<div class="operate panel panel-default">	<div class="panel-body">
	<div class="pull-right">
		<a onclick="add()" class="btn btn-default">新增</a>
		<a onclick="save()" class="btn btn-default">保存</a>
	</div>
</div></div>
<!-- 功能操作区域结束 -->
<!-- 列表显示区域  -->
<div class="row">
	<div class="col-md-4 sub_left_menu">
		<div class="wrap">
			<?php echo $menu ?>
		</div>
	</div>
	<div class="col-md-8 last sub_content ">
		<form id="form_data" name="form_data"method="post" action="">
			<input type="hidden" name="id" id="id">
			<input type="hidden" name="pid" id="pid" value="{$pid}">
			<input type="hidden" name="ajax" id="ajax" value="1">
			<input type="hidden" name="opmode" id="opmode" value="">
			<table class="table table-bordered">
				<tr>
					<th>
					<nobr>
						编码*
					</nobr></th>
					<td>
					<input type="text" id="duty_no" name="duty_no"  check="require" msg="请输入分类编码">
					</td>
				</tr>
				<tr>
					<th>名称*</th>
					<td>
					<input type="text" id="name" name="name"  check="require" msg="请输入名称">
					</td>
				</tr>
				<tr>
					<th>排序</th>
					<td>
					<input type="text" id="sort" name="sort">
					</td>
				</tr>
				<tr>
					<th>状态</th>
					<td>
					<select   name="is_del" id="is_del">
						<option  value="0">启用</option>
						<option value="1">禁用</option>
					</select></td>
				</tr>
				<tr>
					<th>备注</th>
					<td>					<textarea id="remark" name="remark" rows="" cols=""></textarea></td>
				</tr>
			</table>
		</form>
	</div>
</div>